<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Unicode::CaseFold - Unicode case-folding for case-insensitive lookups. - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Unicode-CaseFold - MetaCPAN" href="https://metacpan.org/dist/Unicode-CaseFold/releases.rss" />
        <link rel="canonical" href="./Unicode::CaseFold.html" />
        <meta name="description" content="Unicode case-folding for case-insensitive lookups." />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Unicode::CaseFold" />
<meta name="twitter:title"       content="Unicode::CaseFold" />
<meta name="twitter:description" content="Unicode case-folding for case-insensitive lookups." />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Unicode::CaseFold.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Unicode-CaseFold was released.">
      <span class="relatize">25 Jul 2017 05:17:49 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Unicode-CaseFold">Unicode-CaseFold</a>
  </li>
  <li>
    Module version: 1.01
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Unicode-CaseFold/source/lib/Unicode/CaseFold.pm">Source</a>
    (<a href="https://metacpan.org/dist/Unicode-CaseFold/source/lib/Unicode/CaseFold.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Unicode-CaseFold/source/lib/Unicode">Browse</a>
    (<a href="https://metacpan.org/dist/Unicode-CaseFold/source/lib/Unicode?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Unicode-CaseFold/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="http://metacpan.org/release/Unicode-CaseFold">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Unicode-CaseFold/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/arodland/Unicode-CaseFold">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-CaseFold">Issues</a>
      (2)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Unicode-CaseFold+1.01" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-CaseFold.html?oncpan=1&amp;distmat=1&amp;version=1.01&amp;grade=2" style="color: #090">81</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-CaseFold.html?oncpan=1&amp;distmat=1&amp;version=1.01&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-CaseFold.html?oncpan=1&amp;distmat=1&amp;version=1.01&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/ARODLAND/Unicode-CaseFold-1.01">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Unicode-CaseFold who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 0
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Unicode-CaseFold-1.01/index.html">78.95% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.8.1
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Unicode-CaseFold/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/A/AR/ARODLAND/Unicode-CaseFold-1.01.tar.gz">
      Download (<span itemprop="fileSize">66.71KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FARODLAND%2FUnicode-CaseFold-1.01%2Flib%2FUnicode%2FCaseFold.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Unicode-CaseFold/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Unicode-CaseFold/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Unicode-CaseFold">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Unicode-CaseFold">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Unicode/CaseFold.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="ARODLAND/Unicode-CaseFold-1.01"
>1.01
  (ARODLAND on 2017-07-25)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-1.00"
>1.00
  (ARODLAND on 2014-05-05)</option>
<optgroup label="BackPAN">'
<option
  
  value="ARODLAND/Unicode-CaseFold-0.03"
>0.03
  (ARODLAND on 2012-06-27)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.02"
>0.02
  (ARODLAND on 2011-11-12)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.01"
>0.01
  (ARODLAND on 2011-11-12)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/ARODLAND/Unicode-CaseFold-1.01/diff/' + encodeURIComponent(this.value) + '/lib/Unicode/CaseFold.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="ARODLAND/Unicode-CaseFold-1.01"
>1.01
  (ARODLAND on 2017-07-25)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-1.00"
>1.00
  (ARODLAND on 2014-05-05)</option>
<optgroup label="BackPAN">'
<option
  
  value="ARODLAND/Unicode-CaseFold-0.03"
>0.03
  (ARODLAND on 2012-06-27)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.02"
>0.02
  (ARODLAND on 2011-11-12)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.01"
>0.01
  (ARODLAND on 2011-11-12)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Exporter" title="Exporter" class="ellipsis">Exporter</a></li>
  <li><a href="https://metacpan.org/pod/Scalar::Util" title="Scalar::Util" class="ellipsis">Scalar::Util</a></li>
  <li><a href="https://metacpan.org/pod/Unicode::UCD" title="Unicode::UCD" class="ellipsis">Unicode::UCD</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Unicode::CaseFold/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Unicode%3A%3ACaseFold">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Unicode-CaseFold">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/ARODLAND/Unicode-CaseFold-1.01/view/lib/Unicode/CaseFold.pm">This version</a>
    </li>
    <li>
      <a href="./Unicode::CaseFold.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/PATCH"><img src="https://www.gravatar.com/avatar/3cab2cdaf129f5574e20c2b168b4c389?d=identicon&amp;s=20" title="PATCH" alt="PATCH"></a>
<a class="display-all" href="https://metacpan.org/author/SYP"><img src="https://www.gravatar.com/avatar/9b6fa62677be03c25ee1af4d95472042?d=identicon&amp;s=20" title="SYP" alt="SYP"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Unicode-CaseFold/plussers">2 PAUSE users</a>
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/ARODLAND" class="author-name">Andrew Rodland</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Unicode/CaseFold.pm&#39;" class="">
<option
  selected
  value="ARODLAND/Unicode-CaseFold-1.01"
>1.01
  (ARODLAND on 2017-07-25)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-1.00"
>1.00
  (ARODLAND on 2014-05-05)</option>
<optgroup label="BackPAN">'
<option
  
  value="ARODLAND/Unicode-CaseFold-0.03"
>0.03
  (ARODLAND on 2012-06-27)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.02"
>0.02
  (ARODLAND on 2011-11-12)</option>
<option
  
  value="ARODLAND/Unicode-CaseFold-0.01"
>0.01
  (ARODLAND on 2011-11-12)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Unicode-CaseFold">Unicode-CaseFold-1.01</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 9 direct dependents &#10;          • 25 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Unicode-CaseFold-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Unicode-CaseFold-1.01">
    <input type="hidden" name="author" value="ARODLAND">
    <input type="hidden" name="distribution" value="Unicode-CaseFold">
    <button type="submit" class="favorite highlight"><span>2</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Unicode::CaseFold.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>2</span> ++</a>
</div>
   / <span>Unicode::CaseFold</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Unicode::CaseFold.html#NAME">NAME</a></li>
  <li><a href="./Unicode::CaseFold.html#VERSION">VERSION</a></li>
  <li><a href="./Unicode::CaseFold.html#SYNOPSIS">SYNOPSIS</a>
    <ul>
      <li><a href="./Unicode::CaseFold.html#What-is-Case-Folding?">What is Case-Folding?</a></li>
      <li><a href="./Unicode::CaseFold.html#Use-for-Case-insensitive-Comparison">Use for Case-insensitive Comparison</a></li>
      <li><a href="./Unicode::CaseFold.html#Use-for-String-Lookups">Use for String Lookups</a></li>
    </ul>
  </li>
  <li><a href="./Unicode::CaseFold.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Unicode::CaseFold.html#EXPORTS">EXPORTS</a>
    <ul>
      <li><a href="./Unicode::CaseFold.html#fc($str)">fc($str)</a></li>
      <li><a href="./Unicode::CaseFold.html#case_fold($str)">case_fold($str)</a></li>
    </ul>
  </li>
  <li><a href="./Unicode::CaseFold.html#VARIABLES">VARIABLES</a>
    <ul>
      <li><a href="./Unicode::CaseFold.html#$Unicode::CaseFold::XS">$Unicode::CaseFold::XS</a></li>
      <li><a href="./Unicode::CaseFold.html#$Unicode::CaseFold::SIMPLE_FOLDING">$Unicode::CaseFold::SIMPLE_FOLDING</a></li>
    </ul>
  </li>
  <li><a href="./Unicode::CaseFold.html#COMPATIBILITY">COMPATIBILITY</a></li>
  <li><a href="./Unicode::CaseFold.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Unicode::CaseFold.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Unicode::CaseFold.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Unicode::CaseFold - Unicode case-folding for case-insensitive lookups.</p>

<h1 id="VERSION">VERSION</h1>

<p>version 1.01</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use Unicode::CaseFold;
    
    my $folded = fc $string;</code></pre>

<h2 id="What-is-Case-Folding?"><a id="What"></a><a id="What-is-Case-Folding"></a>What is Case-Folding?</h2>

<p>In non-Unicode contexts, a common idiom to compare two strings case-insensitively is <code>lc($this) eq lc($that)</code>. Before comparing two strings we <i>normalize</i> them to an all-lowercase version. <code>&quot;Hello&quot;</code>, <code>&quot;HELLO&quot;</code>, and <code>&quot;HeLlO&quot;</code> all have the same lowercase form (<code>&quot;hello&quot;</code>), so it doesn&#39;t matter which one we start with; they are all equal to one another after <code>lc</code>.</p>

<p>In Unicode, things aren&#39;t so simple. A Unicode character might have mappings for <i>uppercase</i>, <i>lowercase</i>, and <i>titlecase</i>, and the lowercase mapping of the uppercase mapping of a given character might not be the character that you started with! For example <code>lc(uc(&quot;\N{LATIN SMALL LETTER SHARP S&quot;))</code> is <code>&quot;ss&quot;</code>, not the eszett we started off with! Case-folding is a part of the Unicode standard that allows any two strings that differ from one another only by case to map to the same &quot;case-folded&quot; form, even when those strings include characters with complex case-mappings.</p>

<h2 id="Use-for-Case-insensitive-Comparison"><a id="Use"></a>Use for Case-insensitive Comparison</h2>

<p>Simply write <code>fc($this) eq fc($that)</code> instead of <code>lc($this) eq lc($that)</code>. You can also use <code>index</code> on case-folded strings for substring search.</p>

<h2 id="Use-for-String-Lookups"><a id="Use1"></a>Use for String Lookups</h2>

<p>Frequently we want to store data in a hash, or a database, or an external file for later retrieval. Sometimes we want to be able to match the keys in this data case-insensitively -- that is, we should be able to store some data under the key &quot;hello&quot; and later retrieve it with the key &quot;HELLO&quot;. Some databases have complete support for collation, but in other databases the support is missing or broken, and Perl hashes don&#39;t support it at all. By making case-folding part of the process you use to normalize your keys before using them to access a database or data structure, you get case-insensitive lookup.</p>

<pre><code>    $roles{fc &quot;Samuel L. Jackson&quot;} = [&quot;Gin Rummy&quot;, &quot;Nick Fury&quot;, &quot;Mace Windu&quot;];
    
    $roles = $roles{fc &quot;Samuel l. JACKSON&quot;}; # Gets the data.</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module provides Unicode case-folding for Perl. Case-folding is a tool that allows a program to make case-insensitive string comparisons or do case-insensitive lookups.</p>

<h1 id="EXPORTS">EXPORTS</h1>

<h2 id="fc($str)"><a id="fc"></a><a id="fc-str"></a>fc($str)</h2>

<p>Exported by default when you use the module. <code>use Unicode::CaseFold ()</code> or <code>use Unicode::CaseFold qw(case_fold !fc)</code> if you don&#39;t want it to be exported.</p>

<p>Returns the case-folded version of <code>$str</code>. This function is prototyped to act as much as possible like the built-ins <code>lc</code> and <code>uc</code>; it imposes a scalar context on its argument, and if called with no argument it will return the case-folded version of <code>$_</code>.</p>

<h2 id="case_fold($str)"><a id="case_fold"></a><a id="case_fold-str"></a>case_fold($str)</h2>

<p>Exported on request. Just like <code>fc</code>, except that it has no prototype and won&#39;t case-fold <code>$_</code> if called without an argument.</p>

<h1 id="VARIABLES">VARIABLES</h1>

<h2 id="$Unicode::CaseFold::XS"><a id="Unicode::CaseFold::XS"></a>$Unicode::CaseFold::XS</h2>

<p>Whether the XS extension is in use. The pure-perl implementation is 5-10 times slower than the XS extension, and on versions of perl before 5.10.0 it will use simple case-folding instead of full case-folding (see below).</p>

<h2 id="$Unicode::CaseFold::SIMPLE_FOLDING"><a id="Unicode::CaseFold::SIMPLE_FOLDING"></a>$Unicode::CaseFold::SIMPLE_FOLDING</h2>

<p>Is set to true if the perl version is prior to 5.10.0 and the XS extension is not available. In this case, <code>fc</code> will perform a simple case-folding instead of a full case-folding. Although relatively few characters are affected, strings case-folded using simple folding might not compare equal to the corresponding strings case-folded with full folding, which may cause compatibility issues.</p>

<p>Furthermore, when simple folding is in use, some strings that would have case-folded to the same value when using full folding will instead case-fold to different values. For example, <code>fc(&quot;Wei\x{df}&quot;)</code> and <code>fc(&quot;Weiss&quot;)</code> both produce <code>&quot;weiss&quot;</code> when full folding is in effect, but the former produces <code>&quot;wei\x{df}&quot;</code> when using simple folding.</p>

<p>If you want to check for this potentially dangerous situation, consult the <code>$Unicode::CaseFold::SIMPLE_FOLDING</code> variable.</p>

<h1 id="COMPATIBILITY">COMPATIBILITY</h1>

<ul>

<li><p><code>Unicode::CaseFold</code> requires Perl 5.8.1 or newer.</p>

</li>
<li><p>Different versions of perl include different versions of the Unicode database, which is revised over time. If you are likely to be comparing strings that have been folded using different versions of perl, you may need to consult the changes for intervening Unicode standard versions to find out whether your code will work correctly.</p>

</li>
<li><p><code>Unicode::CaseFold</code> uses &quot;simple&quot; rather than &quot;full&quot; case-folding when operating in Pure-perl mode on perl versions previous to 5.10.0. For compatibility implications, see <a href="./Unicode::CaseFold.html#$Unicode::CaseFold::SIMPLE_FOLDING">&quot;$Unicode::CaseFold::SIMPLE_FOLDING&quot;</a>.</p>

</li>
</ul>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<ul>

<li><p><a href="http://unicode.org/reports/tr21/tr21-5.html">http://unicode.org/reports/tr21/tr21-5.html</a>: Unicode Standard Annex #21: Case Mappings</p>

</li>
</ul>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Andrew Rodland &lt;arodland@cpan.org&gt;</p>

<h1 id="COPYRIGHT-AND-LICENSE"><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>This software is copyright (c) 2017 by Andrew Rodland.</p>

<p>This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Unicode::CaseFold, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Unicode::CaseFold</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Unicode::CaseFold</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Unicode::CaseFold.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
